package org.eCon.maven.plugin;

import org.eCon.maven.iPlugin.IHost;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.execution.MavenSession;

import java.util.List;
import java.util.Map;
import java.util.Iterator;

/**
 * User: erkink
 * Date: 14-Aug-2008
 * Time: 19:38:15
 */
public abstract class AbstractGWTRunPlugin extends AbstractGWTPlugin
        implements IHost {


    protected List classpathElements;

    protected Artifact projectArtifact;

    protected List compileSourceRoots;

    protected Map javaArguments;

    protected String javaArgument;

    protected MavenSession session;

    protected String getClasspath() {

        StringBuilder sb = new StringBuilder(100);
        sb.append(super.getClasspath());

        if(classpathElements != null && classpathElements.size() > 0){
            Iterator iterator = classpathElements.iterator();
            while(iterator.hasNext()){
                sb.append(iterator.next()).append(cpDelimiter);
            }            
        }

        return sb.toString();
    }

    public void setClasspathElements(List classpathElements) {
        this.classpathElements = classpathElements;
    }

    public void setProjectArtifact(Artifact projectArtifact) {
        this.projectArtifact = projectArtifact;
    }

    public void setCompileSourceRoots(List compileSourceRoots) {
        this.compileSourceRoots = compileSourceRoots;
    }

    public void setJavaArguments(Map javaArguments) {
        this.javaArguments = javaArguments;
    }

    public void setJavaArgument(String javaArgument) {
        this.javaArgument = javaArgument;
    }

    public void setSession(MavenSession session) {
        this.session = session;
    }
}
